package com.lyfei.ydc.api;

import com.lyfei.ydc.domain.entity.Spu;
import com.lyfei.ydc.service.ThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/theme")
public class ThemeController {
    @Autowired
    public ThemeService themeService;

    @GetMapping("/spuList/by/name/{name}")
    public List<Spu> getSpuListByThemeName(@PathVariable String name) {
        return themeService.getSpuListByThemeName(name);
    }
}
